home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / C64 / B-Business / (c)b2.d64 / miniwordpro.c (.txt) < prev    next >
Commodore BASIC  |  2007-02-04  |  3KB  |  116 lines

  1. 1000 REM MINIWORDPRO.4
  2. 1010 REM R MACNAUGHTON
  3. 1015 REM MODIFIED FOR COMMODORE-64
  4. 1017 REM BY W. M. STROME
  5. 1020 REM WEST HUMBER C I
  6. 1030 REM MARCH 1982
  7. 1035 REM REVISED FEBRUARY 1983
  8. 1040 DIM A$(25),C$(255)
  9. 1042 POKE53272,23:REM UPPER/LOWER CASE
  10. 1045 ID=8:REM INPUT 8-DISK 1-TAPE
  11. 1050 OD=8:REM OUTPUT 8-DISK 1-TAPE
  12. 1052 QC=204:QL=209:QH=210:QP=211:QQ=212:WD=40:LS=25:SC=1024
  13. 1055 N$="FILE"
  14. 1070 PRINT"[147][212]HINKING... ":GOSUB1870
  15. 1100 CU=SC+WD*2:CR=SC+WD:CX=CR+(LS-1)*WD-3:CT=CR+(LS-2)*WD
  16. 1120 CM=SC+WD*2
  17. 1130 POKEQQ,0:PRINT"\[215]RITE[146]      \[211]AVE     \[204]OAD       \[208]RINT";:POKEQC,0
  18. 1140 PRINT"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
  19. 1150 GETC$:IFC$=""THEN1150
  20. 1160 C=ASC(C$)
  21. 1170 CP=PEEK(QL)+256*PEEK(QH)+PEEK(QP):POKEQC,1:POKECP,PEEK(CP)AND127
  22. 1180 IFCP>CMTHENCM=CP:IFCM>CXTHENCM=CX
  23. 1190 IFC$="\"THEN1460
  24. 1200 IF(CAND127)>31THEN1310
  25. 1210 IF(C=13ORC=141)ANDCP<CT-WDTHENPOKEQC,1:C$=CHR$(13):GOTO1310
  26. 1220 IFC$=""THENPRINT"";:POKEQC,0:GOTO1150
  27. 1230 IFC=20ANDCP>CU THENPRINT"[157]";:GOSUB1350:POKEQC,0:GOTO1150
  28. 1240 IFC=29THEN1310
  29. 1250 IFC=157ANDCP>CU THEN1320
  30. 1260 IFC=148ANDCP<CX THENGOSUB1380:POKEQC,0:GOTO1150
  31. 1270 IFC$="[147]"THEN1410
  32. 1280 IFC$=""ANDCP<CT-2THEN1310
  33. 1290 IFC$="[145]"ANDCP>CU+WD-1THEN1320
  34. 1300 POKEQC,0:GOTO1150
  35. 1310 IFCP>CXTHENPOKEQC,0:GOTO1150
  36. 1320 PRINTC$;:POKEQC,0
  37. 1330 IFC=34THENPOKE QQ,0
  38. 1340 GOTO1150
  39. 1350 FORI=CP-1TOCM:POKEI,PEEK(I+1)
  40. 1360 NEXTI:CM=CM-1
  41. 1370 POKEI,32:RETURN
  42. 1380 FORI=CM+1TOCPSTEP-1:POKEI,PEEK(I-1)
  43. 1390 NEXTI
  44. 1400 POKECP,32:CM=CM+1:RETURN
  45. 1410 PRINT"\[195]LEAR?([217]/[206])[146]\[211]AVE     \[204]OAD       \[208]RINT";
  46. 1420 PRINT"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
  47. 1430 GETC$:IFC$=""THEN1430
  48. 1440 IFC$<>"Y"THEN1130
  49. 1450 PRINT"[147]":GOTO1120
  50. 1460 POKEQQ,0:PRINT"\[215]RITE      \[211]AVE     \[204]OAD       \[208]RINT";
  51. 1470 PRINT"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
  52. 1480 GETCC$:IFCC$=""THEN1480
  53. 1482 IFCC$="P"THEN1790
  54. 1485 IFCC$="W"THEN1130
  55. 1490 IFCC$="S"THEN1525
  56. 1500 IFCC$="L"THEN1655
  57. 1520 GOTO1480
  58. 1525 IFID=8OROD=8THEN GOSUB6000
  59. 1530 PRINT"\[215]RITE      \[211]AVE[146]     \[204]OAD       \[208]RINT";
  60. 1540 PRINT"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
  61. 1550 LN=INT((CM-CR)/40)
  62. 1560 IFCM-CR=40THEN1130
  63. 1570 FORL=1TOLN:A$(L)=""
  64. 1580 FORM=0TOWD-1:C=CR+WD*L+M
  65. 1590 IFC>CXTHEN1610
  66. 1600 A$(L)=A$(L)+C$(PEEK(C)):POKEC,32:NEXTM,L
  67. 1610 PRINT"":IFOD=1THENOPEN3,1,1
  68. 1620 IFOD=8THENOPEN3,8,3,"@0:"+N$+",S,W"
  69. 1630 PRINT#3,LN;CHR$(13);:FORL=1TOLN:PRINT#3,A$(L);:NEXTL
  70. 1640 CLOSE3
  71. 1645 PRINT"[147]":FORL=1TOLN:PRINTA$(L);:NEXTL
  72. 1650 GOTO1460
  73. 1655 IFID=8OROD=8THEN GOSUB6000
  74. 1660 PRINT"\[215]RITE      \[211]AVE     \[204]OAD[146]       \[208]RINT";
  75. 1670 PRINT"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
  76. 1680 IFID=1THENOPEN3,1,0
  77. 1690 IFID=8THENOPEN3,8,3,"0:"+N$+",S,R"
  78. 1700 PRINT"";:INPUT#3,LN
  79. 1710 FORL=1TOLN
  80. 1720 FORM=1TOWD
  81. 1725 IFL=23ANDM>=WD-1THEN1750
  82. 1730 GET#3,C$:PRINTC$;:POKE QQ,0
  83. 1750 NEXTM,L
  84. 1760 CLOSE3
  85. 1770 CM=LN*40+CR:IFCM>CXTHENCM=CX
  86. 1780 GOTO1130
  87. 1790 PRINT"\[215]RITE      \[211]AVE     \[204]OAD       \[208]RINT[146]";
  88. 1800 PRINT"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
  89. 1810 OPEN4,4,7
  90. 1820 LN=INT(.5+(CM-CR)/40)
  91. 1830 FORL=1TOLN:PRINT#4,""TAB(20);:IFPEEK(53272)=23THENPRINT#4,"[147]";
  92. 1840 FORM=0TO39:C=CR+40*L+M
  93. 1850 PRINT#4,C$(PEEK(C));:NEXTM:PRINT#4:NEXTL:PRINT#4:PRINT#4:CLOSE4
  94. 1860 GOTO1130
  95. 1870 FORI=0TO31:C$(I)=CHR$(I+64):NEXT
  96. 1885 FORI=32TO63:C$(I)=CHR$(I):NEXT
  97. 1890 FORI=64TO95:C$(I)=CHR$(I+128):NEXT
  98. 1900 FORI=96TO127:C$(I)=CHR$(I+64):NEXT
  99. 1910 RETURN
  100. 6000 PRINT"                                        ";
  101. 6010 PRINT"[215]HAT IS THE FILE NAME";:GOSUB60000
  102. 6020 IFLEN(IN$)=0THEN IN$=N$:PRINTN$:FORI=1TO500:NEXT
  103. 6030 N$=IN$:RETURN
  104. 60000 REM INPUT ROUTINE #1
  105. 60010 TF=20:TT=0:IN$="":PRINT"? [166][157]";
  106. 60020 GETC$:TT=TT+1:IFTT>TFTHENPRINT" [157]";
  107. 60030 IFTT>TF*2THENPRINT"[166][157]";:TT=0
  108. 60040 IFC$=""THEN60020
  109. 60050 LE=LEN(IN$)
  110. 60060 IFC$="[146]"ANDPEEK(788)=88THENPOKE788,85:GOTO60020:REM RE-ENABLE STOP KEY
  111. 60070 IF(ASC(C$)AND127)>31ANDC$<>CHR$(34)ANDLE<16THEN60110
  112. 60080 IFC$=CHR$(13)THEN IN=VAL(IN$):PRINT" ";:RETURN
  113. 60090 IFC$=CHR$(20)ANDLE>0THENIN$=LEFT$(IN$,LE-1):PRINT"[157][166] [157][157]";
  114. 60100 GOTO60020
  115. 60110 IN$=IN$+C$:PRINTC$"[166][157]";:GOTO60020
  116.